function OSGBGroupNode() {
    OSGBNode.call( this );

    this.childrens = [];
}

OSGBGroupNode.prototype = Object.assign( Object.create( OSGBNode.prototype ), {

    isGroup: function () {
        return true;
    },

    isVisible: function (camera) {
        for (var i = 0; i < this.childrens.length; i++) {
            var childNode = this.childrens[i];
            if (childNode != null) {
                if (childNode.isVisible(camera)) {
                    return true;
                }
            }
        }
        return false;
    },

    getWorldBoundingBox: function () {
        var boundingBox = new THREE.Box3();
        for (var i = 0; i < this.childrens.length; ++i) {
            var childNode = this.childrens[i];
            if (childNode != null) {
                var WorldBoundingBox = childNode.getWorldBoundingBox();
                if (boundingBox.equals(new THREE.Box3())) {
                    boundingBox = WorldBoundingBox;
                } else {
                    boundingBox.union(WorldBoundingBox);
                }
            }
        }
        return boundingBox;
    },

    traverse: function (camera, tileset) {
        var isVisibleChild = false;

        for (var i = 0; i < this.childrens.length; ++i)
        {
            var childNode = this.childrens[i];
            if (childNode != null)
            {
                if (childNode.isVisible(camera))
                {
                    childNode.accept(camera, tileset);
                    isVisibleChild = true;
                }
                else
                {
                    if (childNode.isGroup())
                    {
                        var groupNode = childNode;
                        if (groupNode.getChildrenCount() > 1)
                        {
                            var groupChildNode = groupNode.getChild(1);
                            this.removeChild(groupChildNode);
                            this.releaseChild(groupChildNode, tileset);
                        }
                    }
                }
            }
        }

        return isVisibleChild;
    },

    releaseChild: function (node, tileset) {
        if (node.isGroup()) {
            var groupNode = node;
            for (var i = 0; i < groupNode.childrens.length; ++i){
                var childNode = groupNode.childrens[i];
                if (childNode != null) {
                    groupNode.releaseChild(childNode, tileset);
                }
            }
            groupNode.childrens.length = 0;

            OSGBNode.prototype.releaseChild.call(this, node, tileset);
        } else {
            node.releaseChild(node, tileset);
        }
    },

    addChild: function (node) {
        this.childrens.push(node);
    },

    removeChild: function (node) {
        var parentNode = node.getParent();
        if (parentNode != null) {
            for (var i = 0; i < parentNode.childrens.length; i++) {
                if (node == parentNode.childrens[i]) {
                    parentNode.childrens.splice(i, 1);
                    parentNode.setState(OSGBNodeState.UnLoad);
                    break;
                }
            }
        }
    },

    getChild: function (index) {
        return this.childrens[index];
    },

    getChildrenCount: function () {
        return this.childrens.length;
    },

    removeAllChild: function () {
        this.childrens.length = 0;
        this.release();
    },

} );
